package com.kolakcc.loljclient.util;

import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

public class StatusIcon {
	private static ImageIcon available;
	private static ImageIcon away;
	private static ImageIcon inGame;
	private static ImageIcon offline;
	
	private static ImageIcon loadIcon(String fn) {
		try {
			return new ImageIcon(ImageIO.read(new File("loljclient/img/"+fn+".png"))); 
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	public static ImageIcon getAvailable() {
		if (available == null) {
			available = loadIcon("available");
		}
		return available;
	}
	public static ImageIcon getAway() {
		if (away == null) {
			away = loadIcon("away");
		}
		return away;
	}
	public static ImageIcon getInGame() {
		if (inGame == null) {
			inGame = loadIcon("extended-away");
		}
		return inGame;
	}
	public static ImageIcon getOffline() {
		if (offline == null) {
			offline = loadIcon("invisible");
		}
		return offline;
	}
}
